<?php


namespace App\HttpController\Mp1;


use App\Bizs\Mp1\CommentBiz;
use App\Exceptions\BizException;
use Base\BaseController;

class Comment extends BaseController
{
    /**
     * @Apiname 发送评论
     * @Param give_id {"type": "int", "require": true, "desc": "送养id"}
     * @Param content {"type": "string", "require": true, "desc": "评论内容"}
     * @throws BizException
     */
    public function sendComment()
    {
        $this->returnJson(
            (new CommentBiz())->sendComment($this->params, $this->uid)
        );
    }

    /**
     * @Apiname 删除评论
     * @Param id {"type": "int", "require": true, "desc": "评论id"}
     * @throws BizException
     */
    public function deleteComment()
    {
        $this->returnJson(
            (new CommentBiz())->deleteComment($this->params, $this->uid)
        );
    }

    /**
     * @Apiname 获取评论列表
     *
     * @Param give_id {"type": "int", "desc": "送养id"}
     * @Param page {"type": "int", "default": 1, "desc": "第几页"}
     * @Param limit {"type": "int", "default": 20, "desc": "每页几个"}
     */
    public function getCommentList()
    {
        $this->returnJson(
            (new CommentBiz())->getCommentList($this->params)
        );
    }
}
